﻿using CommunityToolkit.Mvvm.ComponentModel;
using MeasureAbstract.Base;
using MeasureAbstract.IVectorNetworkAnalyzer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MeasureAbstract.ISignalGenerator
{
    [INotifyPropertyChanged]
    public abstract partial class ISignalGenerator_V2 : IDeviceBase
    {
        public abstract string Name { get; }
        public abstract string Vender { get; }
        public abstract string Model { get; }
        public abstract string Description { get; }
        public abstract string ID { get; }

        private bool _RadioFrequencyState = false;
        public bool RadioFrequencyState
        {
            get
            {
                return _RadioFrequencyState;
            }
            set
            {
                SetProperty(ref _RadioFrequencyState, value);
            }
        }

        private bool _ConnectState = false;
        public bool ConnectState
        {
            get
            {
                return _ConnectState;
            }
            set
            {
                SetProperty(ref _ConnectState, value);
            }
        }

        private bool _MalfunctionState = false;
        public bool MalfunctionState
        {
            get
            {
                return _MalfunctionState;
            }
            set
            {
                SetProperty(ref _MalfunctionState, value);
            }
        }

        public abstract void Connect();
        public abstract void DisConnect();
        public abstract void ReSet();


        public abstract void SetFrequencyPoint(long StartFrequency_Hz, long EndFrequency_Hz, int PointCount);
        public abstract void SetFrequencyPoint(List<long> FrequencyList_Hz);

        public abstract void SetRadioFrequencyPower(double Power_dB);
        public abstract void OpenRadioFrequency();
        public abstract void CloseRadioFrequency();

        public abstract int Wait(int PollingTime_ms);

        public abstract void SetExternalTriggerIn(string Interface, TriggerSignalType TriggerSignalType, double TriggerDelay_ms = 0);
        public abstract void SetTriggerSource(TriggerSource TriggerSource);


        public abstract void SetTriggerOut(string Interface, TriggerSignalType TriggerSignalType, double Width, double TriggerDelay_ms = 0);
        public abstract void OpenTriggerOut();
        public abstract void CloseTriggerOut();

        public abstract void SetSweepDwellTime(double Time_ms);

        public abstract string GetLastError();
        public abstract int GetAllErrors(ref List<string> Errors);

        public abstract void SendCommands(List<string> Commands);
    }
}
